package com.hrpmar.service;

import com.hrpmar.controller.dto.DestoryDto;
import com.hrpmar.controller.dto.DrugstockDto;
import com.hrpmar.controller.dto.TakestoDto;
import com.hrpmar.pojo.*;
import com.hrpmar.utils.Pager;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * Created by 李松松 on 2017/11/20.
 */
public interface DrugstockService {



    /**
     * 搜索库存
     * @return
     */
    public Pager searchDrugstock(DrugstockDto dto,Integer offset, Integer limit);


    public List<Druginfo> searchDrugstockName();

    /**
     * 根据药品名称进行详细信息查询
     * @param
     * @return
     */
    public Pager searchDetailBydrunNum(DrugstockDto dto,Integer offset,Integer limit);

    /**
     * 根据编号进行查询
     * @param drugNum
     * @return
     */
    public Druginfo searchByNum(String drugNum);


    public Integer updateDrugstockInfoAspect(Drugstock drugstock);


    /**
     * 查询库存不足
     * @return
     */
    public Pager searchDrugstockinsufficient(DrugstockDto dto,Integer offset,Integer limit);


    /**
     * 库存不足不分页
     * @return
     */
    public List<Drugstock> searchKunCunNoFenYe(String drugNum);


    /**
     * 批量补货
     * @param stoNum
     * @param bh
     * @return
     */
    public Map<String,Purdetails> searchDan(String [] stoNum, Integer bh, HttpServletRequest req);


    /**
     * 查询过期药品
     * @return
     */
    public List<Drugstock> searchOverDueDruginfo(DrugstockDto dto);


    /**
     * 销毁
     * @param stoNum
     * @return
     */
    public List<Drugstock> searchDestoryDruginfo(String[] stoNum);


    /**
     * 销毁添加
     * @return
     */
    public Integer addDestoryMasterAspect(Destorymaster destorymaster, String[] stoNum);

    /**
     * 查询库存药品过期
     * @param dto
     * @param offset
     * @param limit
     * @return
     */
    public Pager searchDestoryRecord(DestoryDto dto,Integer offset, Integer limit);

    /**
     * 查询销毁单号详情
     * @param desNum
     * @return
     */
    public List<Destorydetails> searchDestoryDetailsSee(String desNum);

    /**
     * 销毁库存
     */
    public void DestoryDelete(String[] stoNum);


    public void  updateDestoryState(String desNum);


    /**
     * 根据药品编号获取库存批号
     * @param drugNum
     * @return
     */
    public List<Drugstock> searchStoLotnum(String drugNum);

    /**
     * 添加详情到map
     * @param
     * @param req
     * @return
     */
    public String addSessionMap(Drugstock drugstock, HttpServletRequest req);


    public Drugstock searchDrugstockByDrugNumandStoLitunm(String drugNum,String stoLotnum);

    /**
     * 获取全部员工信息
     * @return
     */
    public List<Worker> searchAllWorker();




    public Integer addTakestoDrugstockAspect(Inventorying inventorying,Invdetails invdetails,HttpServletRequest req);


    /**
     * 盘点
     * @return
     */
    public Pager searchTakestoAll(TakestoDto dto,Integer offset, Integer limit);

    /**
     * 查询单个
     * @param invNum
     * @return
     */
    public Inventorying searchDan(String invNum);

    /**
     * 根据柱表编号获取详情
     * @param invNum
     * @return
     */
    public List<Invdetails> searchByInventorying(String invNum);


    /**
     * 校正库存
     * @param invNum
     * @return
     */
    public Integer correctionTakesto(String invNum);

}
